package ar.edu.utn.frsf.proyectofinal.sistemadecontrolmodbus.persistence;

import java.util.Date;
import java.util.List;

import ar.edu.utn.frsf.proyectofinal.sistemadecontrolmodbus.persistence.model.AddressType;
import ar.edu.utn.frsf.proyectofinal.sistemadecontrolmodbus.persistence.model.AddressValue;
import ar.edu.utn.frsf.proyectofinal.sistemadecontrolmodbus.persistence.model.Alarm;
import ar.edu.utn.frsf.proyectofinal.sistemadecontrolmodbus.persistence.model.CompoundCommand;
import ar.edu.utn.frsf.proyectofinal.sistemadecontrolmodbus.persistence.model.Device;
import ar.edu.utn.frsf.proyectofinal.sistemadecontrolmodbus.persistence.model.DeviceType;
import ar.edu.utn.frsf.proyectofinal.sistemadecontrolmodbus.persistence.model.Field;
import ar.edu.utn.frsf.proyectofinal.sistemadecontrolmodbus.persistence.model.SimpleCommand;
import ar.edu.utn.frsf.proyectofinal.sistemadecontrolmodbus.persistence.model.SoundRequest;

public interface DeviceDAO {
	
	public Device findDevice(Integer id);
	
	public String getDeviceTypeName(Device dev);
	
	public Date getLastActivity(Device dev);
	
	public List<Field> getFields(Device dev);
	
	public List<Alarm> getAlarms(Device dev);
	
	public List<CompoundCommand> getCompoundCommands(Device dev);
	
	public List<SimpleCommand> getSimpleCommands(Device dev);
	
	public List<SoundRequest> getSoundRequests(Device dev);

	public Date lastDateActivity(Device device);

	public AddressValue getLastAddressValue(Device device,Integer address, AddressType addressType);

	public void saveValue(Device device, Integer address,Integer value, AddressType addressType);
	
	public void setLastActivity(Device device, Date date);

	public void saveValues(Device device, List<AddressValue> addValues);
	
	public List<DeviceType> listDeviceTypes();
	
	public void saveOrUpdateType(DeviceType type);
	
	public void deleteType(DeviceType type);

	public List<Device> listDevices();
	
	public void saveOrUpdateDevice(Device type);
	
	public void deleteDevice(Device type);
	
}
